﻿package mortal.game.view.copy.singleTowerCopy2.item
{
    import com.mui.controls.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.copy.QuestionCopy.data.*;

    public class SingleTowerLvBtn extends GCellRenderer
    {
        protected var _btn:GLoadedButton;
        private var _info:Object;

        public function SingleTowerLvBtn()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._btn = UIFactory.gLoadedButton(ImagesConst.SigleTowerCopyBtn56_upSkin, 0, 0, 118, 34, this);
            this._btn.label = "";
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._btn.filters = null;
            this._btn = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            this.updateBtn(param1);
            return;
        }// end function

        public function updateBtn(param1:Object) : void
        {
            var _loc_2:* = param1.data as int;
            if (_loc_2 == 0)
            {
                _loc_2 = 56;
            }
            if (this._btn)
            {
                this._btn.dispose();
            }
            this._btn = UIFactory.gLoadedButton(ImagesConst["SigleTowerCopyBtn" + _loc_2 + "_upSkin"], 0, 0, 118, 34, this);
            this._btn.label = "";
            if (_loc_2 > LevelCheckUtil.curLevel)
            {
                this.filters = [FilterConst.colorFilter2];
            }
            else
            {
                this.filters = null;
            }
            return;
        }// end function

        override public function set selected(param1:Boolean) : void
        {
            super.selected = param1;
            if (param1)
            {
                this._btn.filters = [FilterConst.guideTipsFilter];
            }
            else
            {
                this._btn.filters = null;
            }
            return;
        }// end function

    }
}
